package tasks.leetcode;

public class TaskLengthOfLastWord {
    public static void main(String[] args) {

    }
    public int lengthOfLastWord(String s) {
        String[] split = s.split("\\s+");
        int i = split.length - 1;
        String targetStr = split[i];
        return targetStr.length();
    }
}
